﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    @RenderSection("CSS", required: false)
    <script src="@Url.Content("~/Scripts/jquery-1.8.3.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/modernizr-2.6.2.js")" type="text/javascript"></script>
    @RenderSection("Javascript", required: false)
</head>
<body>
    <div class="page">
        <header>
            <div id="title">
                <h1 style="cursor: pointer;" onclick="window.location.href = '@Url.RouteUrl("Default", new { controller = "Home", action = "Index" })';">@System.Web.Configuration.WebConfigurationManager.AppSettings["AMAPName"].ToString()</h1>
            </div>
            <div id="logindisplay">
                @Html.Partial("_LogOnPartial")
            </div>
            <nav>
                <ul id="menu">
                    @if (User.IsInRole("Client"))
                    {
                        <li>@Html.RouteLink("Mon espace", "Client_default", new { controller = "Home", action = "Index" })</li>
                        <li>@Html.RouteLink("Mes paniers", "Client_default", new { controller = "Order", action = "Index" })</li>
                        <li>@Html.RouteLink("Commander", "Client_default", new { controller = "Order", action = "Create" })</li>
                    }
                    else if (User.IsInRole("Supplier"))
                    {
                        <li>@Html.RouteLink("Mon espace", "Supplier_default", new { controller = "Home", action = "Index" })</li>
                        <li>@Html.RouteLink("Proposer des produits", "Supplier_default", new { controller = "Offer", action = "Create" })</li>
                        <li>@Html.RouteLink("Commandes à livrer", "Supplier_default", new { controller = "Delivery", action = "Index" })</li>
                        <li>@Html.RouteLink("Mes revenus", "Supplier_default", new { controller = "Earnings", action = "Index" })</li>
                    }
                    else if (User.IsInRole("President"))
                    {
                        <li>
                            @Html.RouteLink("Accueil", "Admin_default", new { controller = "Home", action = "Index" })
                        </li>
                        <li>
                            @Html.RouteLink("Clients", "Admin_default", new { controller = "Client", action = "List" })
                        </li>
                        <li>
                            @Html.RouteLink("Fournisseurs", "Admin_default", new { controller = "Supplier", action = "List" })
                        </li>
                        <li><a>Volontaires</a>
                            <ul class="menu-menu">
                                <li>@Html.RouteLink("Liste", "Admin_default", new { controller = "Volunteer", action = "List" })</li>
                                <li>@Html.RouteLink("Ajouter", "Admin_default", new { controller = "Volunteer", action = "Add" })</li>
                            </ul>
                        </li>
                        <li><a>Produits</a>
                            <ul class="menu-menu">
                                <li>@Html.RouteLink("Liste", "Admin_default", new { controller = "Product", action = "List" })</li>
                                <li>@Html.RouteLink("Ajouter", "Admin_default", new { controller = "Product", action = "Add" })</li>
                                <li>@Html.RouteLink("Statistiques", "Admin_default", new { controller = "Product", action = "Statistics" })</li>
                            </ul>
                        </li>
                        <li><a>Paniers</a>
                            <ul class="menu-menu">
                                <li>@Html.RouteLink("Créer un panier", "Admin_default", new { controller = "Basket", action = "Create" })</li>
                                <li>@Html.RouteLink("Composition du panier", "Admin_default", new { controller = "Basket", action = "Composition" })</li>
                            </ul>
                        </li>
                        <li><a>Factures</a>
                            <ul class="menu-menu">
                                <li>@Html.RouteLink("Fournisseurs", "Admin_default", new { controller = "Pay", action = "Supplier" })</li>
                                <li>@Html.RouteLink("Autres AMAP", "Admin_default", new { controller = "Pay", action = "Amap" })</li>
                            </ul>
                        </li>
                    }
                    else if (User.IsInRole("Tresorier"))
                    {
                        <li>
                            @Html.RouteLink("Accueil", "Admin_default", new { controller = "Home", action = "Index" })
                        </li>
                        <li><a>Paniers</a>
                            <ul class="menu-menu">
                                <li>@Html.RouteLink("Créer un panier", "Admin_default", new { controller = "Basket", action = "Create" })</li>
                                <li>@Html.RouteLink("Composition du panier", "Admin_default", new { controller = "Basket", action = "Composition" })</li>
                            </ul>
                        </li>
                        <li><a>Factures</a>
                            <ul class="menu-menu">
                                <li>@Html.RouteLink("Fournisseurs", "Admin_default", new { controller = "Pay", action = "Supplier" })</li>
                                <li>@Html.RouteLink("Autres AMAP", "Admin_default", new { controller = "Pay", action = "Amap" })</li>
                            </ul>
                        </li>

                    }
                    else if (User.IsInRole("Compositeur"))
                    {
                        <li>
                            @Html.RouteLink("Accueil", "Admin_default", new { controller = "Home", action = "Index" })
                        </li>
                        <li>
                            @Html.RouteLink("Liste des produits", "Admin_default", new { controller = "Product", action = "List" })
                        </li>
                        <li><a>Paniers</a>
                            <ul class="menu-menu">
                                <li>@Html.RouteLink("Créer un panier", "Admin_default", new { controller = "Basket", action = "Create" })</li>
                                <li>@Html.RouteLink("Composition du panier", "Admin_default", new { controller = "Basket", action = "Composition" })</li>
                            </ul>
                        </li>
                    }
                    else if (User.IsInRole("Preparateur"))
                    {
                        <li>@Html.RouteLink("Accueil", "Admin_default", new { controller = "Home", action = "Index" })</li>
                        <li>@Html.RouteLink("Composition du panier", "Admin_default", new { controller = "Basket", action = "Composition" })</li>
                    }
                    else
                    {
                        <li>@Html.RouteLink("Accueil", "Default", new { controller = "Home", action = "Index" })</li>
                        <li>@Html.RouteLink("À propos", "Default", new { controller = "Home", action = "About" })</li>
                    }
                </ul>
            </nav>
        </header>
        <section id="main">
            @RenderBody()
        </section>
        <footer>
            @if (!User.Identity.IsAuthenticated)
            {
                <div style="text-align: center;">
                    <span>@Html.RouteLink("Créer un compte client", "Client_default", new { controller = "Account", action = "Create" })</span> |
                <span>@Html.RouteLink("Devenir fournisseur", "Supplier_default", new { controller = "Account", action = "Create" })</span>
                </div>
            }
        </footer>
    </div>
</body>
</html>
